import http from '@/utils/http';

export const addCategory = (params: any) => {
    return http.post('bus/indexCategory/add', params);
}

export const updateCategory = (params: any) => {
    return http.post('bus/indexCategory/edit', params);
}
  
export const removeCategory = (params: any) => {
    return http.delete('bus/indexCategory/remove', {params});
}
  
export const getCategoryTreeData = (params: any) => {
    return http.post('bus/indexCategory/tree', params);
}

export const checkCategoryNameUnique = (params: any) => {
    return http.post('bus/indexCategory/checkName', params);
}

export const treeSelectData =(params:any )=>{
    return http.post('bus/indexCategory/treeSelectData', {params});
}

export const treeSelectAll =(params:any)=>{
    return http.post('bus/indexCategory/treeSelectAll', {params});
}


export const selectTopLevel =()=>{
    return http.get('bus/indexCategory/selectTopLevel');
}

export const selectByParentId =(params: any)=>{
    return http.get('bus/indexCategory/selectByParentId/' +params.id);
}

export const selectAllParameters =()=>{
    return http.get('bus/disasters/selectAllParameters');
}



